<template>
  <div>
    <div class="shuju_title mar_b20 mar_t20">
      <div class="shuju_title_text">
        <span>堂食设置</span>
      </div>
    </div>
    <el-form ref="form2" :model="form2" label-width="180px">
      <el-form-item label="距离判断">
        <el-radio-group v-model="form2.distanceOpen">
          <el-radio label="1">开启</el-radio>
          <el-radio label="2">关闭</el-radio>
        </el-radio-group>
        <div class="yb_margin lh16">开启后，将判断用户与门店的距离位置，不在范围内用户将不能下单</div>
      </el-form-item>
      <el-form-item label="距离" v-show="form2.distanceOpen=='1'">
        <el-input-number v-model="form2.distance" controls-position="right" :min="1" :max="1000000"></el-input-number>
        <span class="yb_margin mar_l10">（距离店家{{ form2.distance }}米内正常下单）</span>
      </el-form-item>
      <el-form-item label="结账模式" :required="true" prop="payMode">
        <el-checkbox-group v-model="form2.payMode">
          <el-checkbox label="1" value="1">先结算再就餐</el-checkbox>
          <el-checkbox label="2" value="2">先就餐再结算</el-checkbox>
        </el-checkbox-group>
        <div class="yb_margin lh16">先结算再就餐：指用户下单后需要先支付，商家才打印订单，此模式下不支持用户自行加菜退菜操作</div>
        <div class="yb_margin lh16">先就餐再结算：指用户下单后，商家立即打印订单，此模式下支持用户自行加菜操作，但有很大的逃单风险，请谨慎开启</div>
      </el-form-item>
      <el-form-item label="下单未付款订单">
        <el-radio-group v-model="form2.autoClose">
          <el-radio label="1">开启</el-radio>
          <el-radio label="2">关闭</el-radio>
        </el-radio-group>
        <div class="yb_margin lh16">开启后，如用户下单后超过5分钟未支付，系统将自动关闭此订单，此功能仅限在先结算再就餐模式下生效</div>
      </el-form-item>
      <el-form-item label v-if="form2.autoClose=='1'">
        <el-input v-model="form2.closeTime" placeholder="请输入关闭时间" type="number" style="width: 340px">
          <template slot="append">分钟未付款自动关闭订单</template>
        </el-input>
      </el-form-item>
      <el-form-item label="点餐模式" :required="true" prop="orderMode">
        <el-checkbox-group v-model="form2.orderMode">
          <el-checkbox label="1" value="1">多人点餐</el-checkbox>
          <el-checkbox label="2" value="2">拼桌点餐</el-checkbox>
        </el-checkbox-group>
        <div class="yb_margin lh16">多人点餐：指同桌用户可以同时加菜并可以互相看到点菜内容</div>
        <div class="yb_margin lh16">拼桌点餐：多人共用一桌，各自独立点餐下单</div>
      </el-form-item>
      <el-form-item label="点餐背景图">
        <div class="uploadSource bor_de rel flex curs" v-if="form2.background">
          <label class="statusLabel curs" @mouseenter="enter(1)" @mouseleave="leave(1)">
            <i class="el-icon-check" ref="imgicon1"></i>
            <i class="el-icon-close" @click="deleteMultiImage(form2.background,1)"></i>
          </label>
          <img :src="form2.background" @click="test(1)" class="wid" />
        </div>
        <div class="uploadSource flex-center curs" v-else @click="test(1)">
          <i class="el-icon-plus fon_40 color_d9"></i>
        </div>
      </el-form-item>
      <div class="shuju_title mar_b20 mar_t20">
        <div class="shuju_title_text">
          <span>当面付设置</span>
        </div>
      </div>
      <el-form-item label="买单支持">
        <el-checkbox-group v-model="form2.Orderdiscount">
          <el-checkbox label="1" value="1">优惠券</el-checkbox>
          <el-checkbox label="2" value="2">会员折扣</el-checkbox>
        </el-checkbox-group>
        <div class="yb_margin lh16">当面付支持的优惠方式</div>
      </el-form-item>
      <div class="shuju_title mar_b20 mar_t20">
        <div class="shuju_title_text">
          <span>快餐设置</span>
        </div>
      </div>
      <el-form-item label="下单未付款订单">
        <el-radio-group v-model="form2.fastAutoClose">
          <el-radio label="1">开启</el-radio>
          <el-radio label="2">关闭</el-radio>
        </el-radio-group>
        <div class="yb_margin lh16">开启后，如用户下单后超过5分钟未支付，系统将自动关闭此订单，请谨慎使用</div>
      </el-form-item>
      <el-form-item label v-if="form2.fastAutoClose=='1'">
        <el-input v-model="form2.fastCloseTime" placeholder="请输入关闭时间" type="number" style="width: 340px">
          <template slot="append">分钟未付款自动关闭订单</template>
        </el-input>
      </el-form-item>
    </el-form>
    <attachment-img ref="img1" type="img" @attachment="imgadd1"></attachment-img>
  </div>
</template>

<script>
import attachmentImg from '@/plugins/attachment-img';
export default {
  components: {
    attachmentImg
  }
};
</script>
